package com.cn.yunhe.rentcars.captcah;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.cn.yunhe.rentcars.mapper.BusiLogMapper;

/**
 * 添加日志信息工具类
 * 
 * @author 朱钦明
 *
 */
public class BusiLogUtil{
	
	/**
	 * 添加日志信息
	 * @param request 获取当前request对象
	 * @param busiMapper 往数据库插入日志对应对象
	 * @param map 出入需要插入的信息
	 */
	public static void addBusiLog(HttpServletRequest request,BusiLogMapper busiMapper,Map<String,Object> map){
		HttpSession session = request.getSession();
		String username = (String) session.getAttribute("username");
		String content = (String) map.get("busiconent");
		map.put("busiconent", "操作人员："+username+"----"+content);
		busiMapper.insertBusiLog(map);
	}
}
